home *** CD-ROM | disk | FTP | other *** search
- /*
-
- SolveRubiksCube
- Copyright (c) 1994 J Robert Boonstra
-
- */
-
- #pragma options(honor_register,assign_registers)
-
- #include "rubik.h"
- #include "transform.h"
-
- void SolveTopEdgesFR(register RubiksCube *rub)
- {
-
- /**********************************************************
- *
- * STEP 1: Put the edge cubes in the top layer into
- * the proper position and orientation.
- * Loop until all are correct.
- *
- *********************************************************/
- if (UF_U == U && UF_F == F) {
- /* leave edge in correct position */ ;
- } else if (UF_U == F && UF_F == U) { F2D1R1F3R3;
- } else if (UR_U == F && UR_R == U) { R3F3;
- } else if (UB_U == F && UB_B == U) { B2D3R1F3R3;
- } else if (UL_U == F && UL_L == U) { L1F1;
- } else if (UR_U == U && UR_R == F) { R2D3F2;
- } else if (UB_U == U && UB_B == F) { B2D2F2;
- } else if (UL_U == U && UL_L == F) { L2D1F2;
- } else if (RF_F == F && RF_R == U) { F3;
- } else if (RB_R == F && RB_B == U) { B3D3B1R1F3R3;
- } else if (LB_B == F && LB_L == U) { B1D2B3F2;
- } else if (LF_L == F && LF_F == U) { L1D1L3F2;
- } else if (RF_F == U && RF_R == F) { F1D1R1F3R3;
- } else if (RB_R == U && RB_B == F) { R2F3R2;
- } else if (LB_B == U && LB_L == F) { B1D3B3R1F3R3;
- } else if (LF_L == U && LF_F == F) { F1;
- } else if (DF_D == F && DF_F == U) { D1R1F3R3;
- } else if (DR_D == F && DR_R == U) { R1F3R3;
- } else if (DB_D == F && DB_B == U) { D3R1F3R3;
- } else if (DL_D == F && DL_L == U) { L3F1L1;
- } else if (DF_D == U && DF_F == F) { F2;
- } else if (DR_D == U && DR_R == F) { D3F2;
- } else if (DB_D == U && DB_B == F) { D2F2;
- } else if (DL_D == U && DL_L == F) { D1F2;
- }
- /*
- * Find the top-right edge cube, and move it into the
- * proper position.
- */
- if (UR_U == U && UR_R == R) {
- /* leave edge in correct position */ ;
- } else if (UF_U == R && UF_F == U) { F1R1;
- } else if (UR_U == R && UR_R == U) { R2D1B1R3B3;
- } else if (UB_U == R && UB_B == U) { B3R3;
- } else if (UL_U == R && UL_L == U) { L2D3B1R3B3;
- } else if (UF_U == U && UF_F == R) { F2D1R2;
- } else if (UB_U == U && UB_B == R) { B2D3R2;
- } else if (UL_U == U && UL_L == R) { L2D2R2;
- } else if (RF_F == R && RF_R == U) { F1D1F3R2;
- } else if (RB_R == R && RB_B == U) { R3;
- } else if (LB_B == R && LB_L == U) { L3D3L1B1R3B3;
- } else if (LF_L == R && LF_F == U) { L1D2L3R2;
- } else if (RF_F == U && RF_R == R) { R1;
- } else if (RB_R == U && RB_B == R) { R1D1B1R3B3;
- } else if (LB_B == U && LB_L == R) { B2R3B2;
- } else if (LF_L == U && LF_F == R) { L1D3L3B1R3B3;
- } else if (DF_D == R && DF_F == U) { F3R1F1;
- } else if (DR_D == R && DR_R == U) { D1B1R3B3;
- } else if (DB_D == R && DB_B == U) { B1R3B3;
- } else if (DL_D == R && DL_L == U) { D3B1R3B3;
- } else if (DF_D == U && DF_F == R) { D1R2;
- } else if (DR_D == U && DR_R == R) { R2;
- } else if (DB_D == U && DB_B == R) { D3R2;
- } else if (DL_D == U && DL_L == R) { D2R2;
- }
- }